11. Fixing Data Types Pt 3

Fixing Data Types Part 3

In this last section, you'll fix datatypes of columns for mpg and greenhouse gas score.

After you complete these final fixes, check the datatypes of all features in both datasets to confirm success for all the changes we specified earlier. Here they are again for your reference:

Fix cyl datatype

  • 2008: extract int from string.
  • 2018: convert float to int.

Fix air_pollution_score datatype

  • 2008: convert string to float.
  • 2018: convert int to float.

Fix city_mpg , hwy_mpg , cmb_mpg datatypes

  • 2008 and 2018: convert string to float.

Fix greenhouse_gas_score datatype

  • 2008: convert from float to int.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: jupyter
  • Opened files (when workspace is loaded): n/a

Task Description:

Confirm the following datatypes for BOTH datasets!

Task List:

Task Feedback:

Great job!!